#include "game.h"

void Down1()
{
  //取随机数
  srand(time(NULL));
  //需要下载的大小
  int num = 1024 * 1024 *1024;
  int nnn = num;
  //下载未完成继续下载
  while(num)
  { 
    //休眠1000微秒
    usleep(1000);
    //本次下载的大小
    int download = rand() % (1024 * 1024);
    //还需要的下载量
    num = num - download;
    //下载完成
    if(num < 0)
      num = 0;
    int downnum = nnn - num;
    //下载占需要下载的百分比
    double n = ((downnum * 1.0) / nnn ) * 100.0;
    Progress(n); 
  }
  printf("\n");
}

int main()
{
  Down1();

  return 0;
}

